#include <iostream>
#include <vector>
#include <memory>
#include <cstdlib>
#include <ctime>

using namespace std;

class Employee {
public:
    string name;
    int salary;
    Employee(string name) : name(name) {}
    virtual void calculateSalary() = 0;
    virtual ~Employee() = default;
};

class SalariedEmployee : public Employee {
private:
    int monthSalary;
public:
    SalariedEmployee(string name, int monthSalary) : Employee(name), monthSalary(monthSalary) {}
    void calculateSalary() override {
        salary = monthSalary;
        cout << "SalariedEmployee: " << name << ", salary: " << salary << endl;
    }
};

class HourlyEmployee : public Employee {
private:
    int hours;
    int hourSalary;
public:
    HourlyEmployee(string name, int hourSalary, int hours) : Employee(name), hourSalary(hourSalary), hours(hours) {}
    void calculateSalary() override {
        salary = hourSalary * hours;
        cout << "HourlyEmployee: " << name << ", hourSalary: " << hourSalary << ", hours: " << hours << ", salary: " << salary << endl;
    }
};

int main() {
    vector<unique_ptr<Employee>> employees;
    srand(time(0));

    for (int i = 1; i <= 10; i++) {
        int employType = rand() % 2;
        switch (employType) {
            case 0: {
                int monthSalary = rand() % 10000 + 3000;
                employees.emplace_back(make_unique<SalariedEmployee>("001" +to_string(i), monthSalary));
                break;
            }
            case 1: {
                int hourSalary = std::rand() % 30 + 40;
                int hours = std::rand() % 10 + 4;
                employees.emplace_back(make_unique<HourlyEmployee>("002" + to_string(i), hourSalary, hours));
                break;
            }
        }
    }

    for (const auto&employee : employees) {
        employee->calculateSalary();

    }

    return 0;
}
